import { observable, computed, action } from 'mobx';

class User {
  @observable name = 'John';

  @observable age = 42;

  @observable showAge = false;

  @computed get labelText() {
    return this.showAge ? `${this.name} (age: ${this.age})` : this.name;
  }

  @action setAge(age) {
    this.age = age;
  }
}
export default new User();
